package com.byb.server.service.mapper;

import com.byb.server.domain.*;
import com.byb.server.service.dto.WcClaimCasesDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity WcClaimCases and its DTO WcClaimCasesDTO.
 */
@Mapper(componentModel = "spring", uses = {WcProductMapper.class, })
public interface WcClaimCasesMapper extends EntityMapper <WcClaimCasesDTO, WcClaimCases> {


    @Mapping(source = "wcProduct.id", target = "wcProductId")
    @Mapping(source = "wcProduct.name", target = "wcProductName")
    WcClaimCasesDTO toDto(WcClaimCases wcClaimCases);

    @Mapping(source = "wcProductId", target = "wcProduct")
    WcClaimCases toEntity(WcClaimCasesDTO wcClaimCasesDTO);
    default WcClaimCases fromId(Long id) {
        if (id == null) {
            return null;
        }
        WcClaimCases wcClaimCases = new WcClaimCases();
        wcClaimCases.setId(id);
        return wcClaimCases;
    }
}
